﻿//功能说明：用于系统初始化操作

var Globals = {
    UserInformationDialog: null,       /* 用户信息设置对话框 */
    ShortCutInformationDialog: null,   /* 快捷方式设置对话框 */
    SystemSettingDialog: null,         /* 系统设置对话框     */
    SystemMessageDialog: null,         /* 系统通知对话框　　 */
    OnLineHelp: null,                  /* 在线帮助对话框　　 */
    UseMethod: null,                   /* 使用方法帮助对话框 */
    VideoMethod: null                  /* 视频帮助对话框　　 */
};

var Class_SystemLoad = {
    //初始化系统设置信息
    Init_ItemCard: function () {
        top.Card_Item_Count = 10;
        this.Load_ItemCard();
        this.Init();
    },
    Init: function () {
        this.Load_SystemMessage();
        this.Load_UserInformation();
        this.Load_ShortCutInformation();
        this.Load_SystemSetting();
        this.Load_OnlineHelp();
        this.Load_UseMethod();
        this.Load_VideoMethod();
    },

    //下拉菜单
    MenuFix: function (_objid) {
        var sfEls = document.getElementById(_objid).getElementsByTagName("li");
        for (var i = 0; i < sfEls.length; i++) {
            sfEls[i].onmouseover = function () {
                this.className = (this.className.length > 0 ? " " : "") + "sfhover";
            }
            sfEls[i].onMouseDown = function () {
                this.className = (this.className.length > 0 ? " " : "") + "sfhover";
            }
            sfEls[i].onMouseUp = function () {
                this.className = (this.className.length > 0 ? " " : "") + "sfhover";
            }
            sfEls[i].onmouseout = function () {
                this.className = this.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
            }
        }
    },

    /*初始化选项卡(我的桌面)*/
    Load_ItemCard: function () {
        var model = new top.Class_ItemCardModelNew();
        model.ItemCardCode = "Card_0";
        model.ItemModelCode = "0";
        model.ItemModelName = "我的桌面";
        model.ItemIframeCode = "Card_ifr_0";
        model.ItemIndex = 0;

        model.ItemUrl = "../../Right.aspx";// "/MainAspx/ViewUserMode.aspx";
        model.ItemType = 0;
        top.FocusItemCard = 0; //焦点所在选项卡
        top.Class_ItemCard_OprnNew.Run_ItemCard(null, model.ItemModelName, model.ItemUrl, "");
    },

    /* 在线帮助对话框  */
    Load_OnlineHelp: function () {
        Globals.OnLineHelp = new Window({
            id: 'OnlineHelp',
            width: 510,
            height: 345,
            caption: '在线反馈',

            src: '../../MainAspx/ViewOnlineHelp.aspx',
            modal: true,
            visible: false,
            createOnFirstVisible: true
        });
    },
    /* 使用帮助对话框*/
    Load_UseMethod: function () {
        Globals.UseMethod = new Window({
            id: 'UseMethod',
            width: '100%',
            height: '100%',
            caption: '使用帮助',
            src: '../../helpDoc/Default.aspx',
            modal: true,
            visible: false,
            createOnFirstVisible: true
        });
    },

    /*打开视频对话框*/
    Load_VideoMethod: function () {
        Globals.VideoMethod = new Window({
            id: 'VideoMethod',
            width: '100%',
            height: '100%',
            caption: '视频帮助',

            src: '/SKyDoc/YyDefault.aspx',
            modal: true,
            visible: false,
            createOnFirstVisible: true
        });
    },

    /* 加载个人信息对话框 */
    Load_UserInformation: function () {
        Globals.UserInformationDialog = new Window({
            id: 'UserInformation',
            width: 650,
            height: 540,
            caption: '个人信息设置',

            src: '../../BusinessExpansion/Templete/Upd_User.aspx',
            modal: true,
            visible: false,
            createOnFirstVisible: true
        });
    },

    /* 加载快捷方式对话框　ViewSystemFastInfo.aspx*/
    Load_ShortCutInformation: function () {
        Globals.ShortCutInformationDialog = new Window({
            id: 'ShortCutInformation',
            width: 440,
            height: 370,
            caption: '快捷方式设置',

            src: '../../MainAspx/ViewSystemFastInfo.aspx',
            modal: true,
            visible: false,
            createOnFirstVisible: true
        });
    },

    /* 加载系统信息设置对话框　ViewSystemFastInfo.aspx*/
    Load_SystemSetting: function () {
        Globals.SystemSettingDialog = new Window({
            id: 'SystemSetting',
            width: 350,
            height: 240,
            caption: '系统信息设置',
            src: '../../MainAspx/ShowEmpty.aspx',
            modal: true,
            visible: false,
            createOnFirstVisible: true
        });
    },
    Load_SystemMessage: function () {
    }
    /* 加载系统通知对话框 */
    /*
    Load_SystemMessage: function () {
    Globals.SystemMessageDialog = new Window({
    id: 'SystemMessage',
    width: 260,
    height: 180,
    caption: '系统消息',
    captionHeight: 20,
    src: '/MainAspx/ShowEmpty.aspx',
    modal: false,
    movable: true,
    position: 'right-bottom',
    closeIcon: '/App_Themes/' + top.SystemSkinName + '/Images/up.gif',
    icon: '/App_Themes/' + top.SystemSkinName + '/Images/light_on.gif',
    closeTip: '弹出',
    visible: true,
    closable: false
    });

    var dynamic = null;
    var dialog = Globals.SystemMessageDialog;
    var obj = dialog.getWindow();
    var caption = dialog.getCaption();
    var closer = dialog.getCloserImage();
    var config = dialog.getConfig();

    dialog.Minimised = true;
    dialog.setSize({ width: 114, height: 20});
    dialog.setPosition(config.position);

    Globals.SystemMessageDialog.folder = function () {
    if (dynamic !== null || dialog.Minimised) {
    return;
    }

    closer.title = '弹出';
    dialog.Minimised = true;
    // 折叠
    dynamic = setInterval(function () {
    if (parseInt(obj.style.height) <= 20 + 2 * config.borderSize + 2) {
    clearInterval(dynamic);
    dialog.setSize({ width: 114, height: parseInt(obj.style.height) - 1 });
    dynamic = null;
    closer.src = "/App_Themes/" + top.SystemSkinName + "/Images/up.gif";
    }

    dialog.setSize({ width: NaN, height: parseInt(obj.style.height) - 2 });
    dialog.setPosition(config.position);
    }, 12);
    };

    Globals.SystemMessageDialog.popup = function () {
    if (dynamic !== null || !dialog.Minimised) {
    return;
    }

    closer.title = '折叠';
    dialog.Minimised = false;
    var distance = 20 - config.height;
    // 弹出
    dynamic = setInterval(function () {
    dialog.setSize({ width: config.width, height: parseInt(obj.style.height) + 3 });
    dialog.setPosition(config.position);
    if (parseInt(obj.style.height) >= config.height) {
    clearInterval(dynamic);
    closer.src = "/App_Themes/" + top.SystemSkinName + "/Images/down.gif";
    dynamic = null;
    }
    }, 12);
    };
    Globals.SystemMessageDialog.close = function () {
    if (!dialog.Minimised) {
    Globals.SystemMessageDialog.folder();
    } else {
    Globals.SystemMessageDialog.popup();
    }
    };
    }
    */
}